package freshmanspecial.mredrock.com.welcomefreshman.Adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;

import java.util.ArrayList;

import freshmanspecial.mredrock.com.welcomefreshman.Bean.MilitaryTrainingPhotoBean;
import freshmanspecial.mredrock.com.welcomefreshman.Bean.QQGroupBean;
import freshmanspecial.mredrock.com.welcomefreshman.R;

/**
 * Created by HP on 2017/8/13.
 */

public class QQSearchRecyclerAdapter  extends RecyclerView.Adapter<QQSearchRecyclerAdapter.MyTrainViewHolder>{
    private QQGroupBean bean;
    private Context context;
    private ArrayList<String> list;
    public QQSearchRecyclerAdapter(ArrayList<String> list,Context context){
        this.list = list;
        this.context = context;
    }
    @Override
    public QQSearchRecyclerAdapter.MyTrainViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.special_2017_strategt_qqgroup_item,parent,false);
        QQSearchRecyclerAdapter.MyTrainViewHolder myTrainViewHolder = new QQSearchRecyclerAdapter.MyTrainViewHolder(view);
        return myTrainViewHolder;
    }

    @Override
    public void onBindViewHolder(QQSearchRecyclerAdapter.MyTrainViewHolder holder, int position) {
        holder.textView.setText(list.get(position));
    }

    @Override
    public int getItemCount() {
        return list.size();
    }

    class MyTrainViewHolder extends RecyclerView.ViewHolder{
        TextView textView;
        public MyTrainViewHolder(View itemView) {
            super(itemView);
            textView = itemView.findViewById(R.id.search_item_text);
        }
    }
}
